package com.szj.spushrtmp.util;

import androidx.fragment.app.FragmentActivity;

import com.permissionx.guolindev.PermissionX;
import com.permissionx.guolindev.callback.RequestCallback;

import java.util.List;

/**
 * @ClassName: SPermissionX
 * @Author: s10g
 * @CreateDate: 7/12/23$ 3:31 PM$
 * TODO
 */
public class SPermissionX {

    public static void request(FragmentActivity activity, List<String> ps, final ResultCallBack<Boolean> callBack) {
        PermissionX.init(activity)
                .permissions(ps)
                .request(new RequestCallback() {
                    @Override
                    public void onResult(boolean allGranted, List<String> grantedList, List<String> deniedList) {
//                        Toast.makeText(activity, "权限" + (allGranted ? "通过" : "未通过"), Toast.LENGTH_SHORT).show();
                        callBack.success(allGranted);
                    }
                });


    }
}
